Skip to content

Fix KafkaItemReader ClassCastException during ExecutionContext deserialization #4863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noojung
Copy link
Contributor

@noojung noojung commented Jun 5, 2025

Using Jackson2ExecutionContextStringSerializer causes KafkaItemReader to throw a ClassCastException.

Because KafkaItemReader stores a Map<TopicPartition, Long> in the ExecutionContext, the serializer converts all map keys to strings.

To fix this, I changed it to store only the partition number (as a string) instead of the full TopicPartition object.

Resolves: #3797

… Jackson2ExecutionContextStringSerializer

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>
@noojung noojung changed the title Fix KafkaItemReader ExecutionContext deserialization error when using Jackson2ExecutionContextStringSerializer Fix KafkaItemReader ExecutionContext deserialization error Jul 31, 2025
@noojung noojung changed the title Fix KafkaItemReader ExecutionContext deserialization error Fix KafkaItemReader deserialization error when loading ExecutionContext Jul 31, 2025
@noojung noojung changed the title Fix KafkaItemReader deserialization error when loading ExecutionContext Fix KafkaItemReader ClassCastException during ExecutionContext deserialization Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot deserialize TopicPartition from JobRepository
1 participant